package com.wb.iec104.utils;

import com.wb.iec104.analysis.Bean;

public class JedisUtils {

    public static void setBid(Bean bean) {
        String data_time = bean.getData_time();
        String ymd = data_time.replaceAll("-", "").replaceAll("\\.", "").replaceAll(":", "").replaceAll(" ", "");
        bean.setTimeStr(ymd);
        //0+秒的个数+月+年
        // String flag="0"+data_time.substring(18,19)+data_time.substring(5,7)+data_time.substring(0,4);
        String point_code = bean.getPoint_code();
        String bid = "";
        if (!"".equals(point_code) && null != point_code) {
            // bid=flag+"_"+point_code+"_"+ ymd;// +"_"+System.currentTimeMillis()
            bid = point_code + "_" + ymd;
        } else {
            //bid=flag+"_"+bean.getPort()+"_"+ ymd;
            bid = bean.getPort() + "_" + ymd;
        }
        bean.setBid(bid);
    }
}
